package com.scott;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.scott.annotion.CommandId;
import com.scott.annotion.ModelId;
import com.scott.scanner.HandlerScaner;
import com.scott.scanner.Invoker;
import com.scott.scanner.InvokerHoler;

/**
 * Hello world!
 *
 */
public class App {
	public static void main(String[] args) {
		ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
		HandlerScaner bean = applicationContext.getBean(HandlerScaner.class);
		operator();
	}
	
	public static void operator() {
		Invoker invoker = InvokerHoler.getInvoker(ModelId.USER, CommandId.GET_USER_LIST);
		invoker.invoke();
		
		invoker = InvokerHoler.getInvoker(ModelId.USER, CommandId.GET_BOOK_LIST);
		invoker.invoke();
		
		invoker = InvokerHoler.getInvoker(ModelId.ADMIN, CommandId.GET_USER_LIST);
		invoker.invoke();
		
		invoker = InvokerHoler.getInvoker(ModelId.ADMIN, CommandId.GET_BOOK_LIST);
		invoker.invoke();
	}
}
